feat(search): paginate search_people via max_pages#527
Conversation
Greptile SummaryThis PR adds optional pagination to
Confidence Score: 4/5Safe to merge with one gap to address: the pagination loop has no exception handler, so a mid-run navigation error discards already-fetched pages. The pagination logic, dedup, and early-stop are all correct and well-tested. The one gap is that the per-page loop body has no try/except guard equivalent to what search_jobs uses, so an unexpected exception on any page after the first will propagate up and discard all results already accumulated from prior pages. linkedin_mcp_server/scraping/extractor.py — the search_people pagination loop needs a try/except wrapper matching the search_jobs pattern. Important Files Changed
Reviews (2): Last reviewed commit: "Merge branch 'main' into feature/526-sea..." | Re-trigger Greptile |
Closes #526
Summary
Adds optional pagination to
search_people, mirroring the existingsearch_jobspattern. Previouslysearch_peoplereturned only the first results page (~10 people) with no way to fetch more.Changes
tools/person.py— newmax_pages: Annotated[int, Field(ge=1, le=10)] = 1parameter, forwarded to the extractor; docstring + log updated.scraping/extractor.py—search_peopleloops over LinkedIn's&page=NURL parameter (1-based) up tomax_pages, with_NAV_DELAYbetween navigations. Page texts are joined into the singlesearch_resultssection with\n---\n; references are deduped by URL across pages.kind: personreferences, so over-requesting pages is harmless.max_pages=1preserves the current single-page behavior exactly (opt-in pagination).manifest.jsonupdated.Test plan
uv run ruff format/ruff check/ty check— all pass.uv run pytest— full suite passes (the unrelatedtest_harden_linkedin_tree_noop_outside_linkedinumask-dependent failure also fails onmain).&page=2cursor, early-stop when a page adds no new people. New tool test:max_pagesforwarding.Synthetic prompt
Generated with Claude Opus 4.8